<template>
    <div class="share-contain">
        <div class="title">邀请好友得分红奖励，多邀多得</div>
        <div class="qr-panel">
            <div>莲蕊珠宝</div>
            <img v-lazy="imageShow(qrcode)" />
            <div class="qr-text">长按保存或分享图片</div>
        </div>
    </div>        
</template>

<script>
import { userShare } from "@/api/user"    
export default {
    name: 'share',
    data() {
        return {
            qrcode: '',
        }
    },
    created() {
        this.getQrcode()
    },
    methods: {
        imageShow(src) {
            const img = {};
            img.loading = require("@/assets/images/loading.gif");
            img.src = src;
            return img;
        },
        getQrcode() {
            userShare().then(response => {
                if(response.data) {
                    this.qrcode = response.data
                }
            })
        }
    }
}    
</script>